package com.soulkun.smarthome.logic.service

import com.soulkun.smarthome.logic.dto.*
import com.soulkun.smarthome.logic.model.*
import okhttp3.RequestBody
import retrofit2.Call
import retrofit2.http.Body
import retrofit2.http.GET
import retrofit2.http.Headers
import retrofit2.http.POST

interface ApiFamilyService {

    @Headers("Ignore-Token: false", "Anti-Replay: true")
    @POST("/family/create")
    fun createFamily(@Body requestBody: FamilyRoomDTO): Call<ResponseModel<Any>>

    @Headers("Ignore-Token: false", "Anti-Replay: true")
    @POST("/family/invitation/generate")
    fun generateFamilyInvitation(@Body requestBody: FamilyModel): Call<ResponseModel<FamilyInvitationModel>>

    @Headers("Ignore-Token: false")
    @POST("/family/info/get")
    fun getFamilyDetailInfo(@Body requestBody: FamilyModel): Call<ResponseModel<FamilyDetailInfoDTO>>

    @Headers("Ignore-Token: false", "Anti-Replay: true")
    @POST("/family/name/modify")
    fun modifyFamilyName(@Body requestBody: FamilyModel): Call<ResponseModel<Any>>

    @Headers("Ignore-Token: false", "Anti-Replay: true")
    @POST("/family/location/modify")
    fun modifyFamilyLocation(@Body requestBody: FamilyModel): Call<ResponseModel<Any>>

    @Headers("Ignore-Token: false", "Anti-Replay: true")
    @POST("/family/join")
    fun joinFamily(@Body requestBody: FamilyInvitationDTO): Call<ResponseModel<Any>>

    @Headers("Ignore-Token: false")
    @GET("/family/list/info")
    fun getFamilySimpleInfoList(): Call<ResponseModel<List<FamilyModel>>>

    @Headers("Ignore-Token: false")
    @POST("/family/list/room/info")
    fun getRoomDeviceList(@Body requestBody: FamilyModel): Call<ResponseModel<List<RoomDeviceDTO>>>

    @Headers("Ignore-Token: false", "Anti-Replay: true")
    @POST("/family/delete")
    fun deleteFamily(@Body requestBody: FamilyModel): Call<ResponseModel<Any>>

    @Headers("Ignore-Token: false", "Anti-Replay: true")
    @POST("/family/role/set")
    fun setFamilyUserRole(@Body requestBody: FamilyUserRoleDTO): Call<ResponseModel<Any>>

    @Headers("Ignore-Token: false", "Anti-Replay: true")
    @POST("/family/user/delete")
    fun deleteFamilyUser(@Body requestBody: FamilyUserRoleDTO): Call<ResponseModel<Any>>

    @Headers("Ignore-Token: false")
    @GET("/family/list/role")
    fun getFamilyRoleList(): Call<ResponseModel<List<RoleModel>>>

    @Headers("Ignore-Token: false")
    @POST("/family/list/room&device&command")
    fun getRoomDeviceCommandList(@Body requestBody: FamilyModel): Call<ResponseModel<List<RoomDeviceCommandDTO>>>

}